net/designware: add explicit reset of {tx|rx}_currdescnum
authorAlexey Brodkin <[email protected]>
Mon, 13 Jan 2014 09:28:38 +0000 (13:28 +0400)
committerTom Rini <[email protected]>
Fri, 7 Feb 2014 14:16:26 +0000 (09:16 -0500)
Driver "init" function might be called multiple times.
On every "init" Tx/Rx buffer descriptors are initialized: "descs_init"
-> "{tx|rx}_descs_init".

In its turn those init functions set MAC's "{tx|rx}desclistaddr" to
point on the first buffer descriptor in the list.

So CPU to start operation from the first buffer descriptor as well after
every "init" we have to reset "{tx|rx}_currdescnum".

Cc: Joe Hershberger <[email protected]>
Cc: Vipin Kumar <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: Mischa Jonker <[email protected]>
Signed-off-by: Alexey Brodkin <[email protected]>
drivers/net/designware.c

index 22155b4d949f76587570cbf93001370fc0d7619f..186808943ab09e16731573e0bd92d7452241582e 100644 (file)
@@ -52,6 +52,7 @@ static void tx_descs_init(struct eth_device *dev)
        desc_p->dmamac_next = &desc_table_p[0];
 
        writel((ulong)&desc_table_p[0], &dma_p->txdesclistaddr);
+       priv->tx_currdescnum = 0;
 }
 
 static void rx_descs_init(struct eth_device *dev)
@@ -79,6 +80,7 @@ static void rx_descs_init(struct eth_device *dev)
        desc_p->dmamac_next = &desc_table_p[0];
 
        writel((ulong)&desc_table_p[0], &dma_p->rxdesclistaddr);
+       priv->rx_currdescnum = 0;
 }
 
 static void descs_init(struct eth_device *dev)